<extend name="Public:common" />
<block name="body">
  <div class="pure-u-11-13">
      <div class="index-content-top">     
            <div class="conten-issue">
                <div class="form-box">
                    <form action="__SELF__" method="post">
                        <select name="status">
                            <option value="">审核状态</option>
                            <option value="0">待审核</option>
                            <option value="1">审核通过</option>
                            <option value="2">审核未通过</option>
                        </select>
                        <input type="text" name="username" />
                        <input type="submit" value="搜索"/>
                    </form>
                </div>
            </div>
        </div>
        <div class="zao"></div>
        <table border="1" cellspacing="" cellpadding="" class="index-content-table index-table-head" width="100%">
                <tr>
                    <td>ID</td>
                    <td>模特卡</td>
                    <td>用户名</td>
                    <td>注册时间</td>
                    <td width="200">麻豆卡审核</td>
                </tr>
            <volist name="list" id="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td><img src='__WWWROOT__{$vo.model_card}' alt='模特卡' width="100px" height="120px" /></td>
                    <td>{$vo.username}</td>
                    <td>{$vo.reg_time| date="Y-m-d H:i:s", ###}</td>
                    <if condition='$vo.show_model_card eq 1'>
                        <td style="position: relative;">
                            <span class="wcheck">审核通过</span>
                            <div class="modal-wcheck" style="position: absolute; top: -41%; left: -20%; width: 268px;">
                                <a class="checkyes" id="{$vo.id}" > 审核通过</a>  
                                <a class="checkno" id="{$vo.id}" > 未通过审核</a>
                            </div>
                        </td>
                    <elseif condition='$vo.show_model_card eq 2'/>
                        <td style="position: relative;">
                            <span class="wcheck">审核未通过</span>
                            <div class="modal-wcheck" style="position: absolute; top: -41%; left: -20%; width: 268px;">
                                <a class="checkyes" id="{$vo.id}" > 审核通过</a>  
                                <a class="checkno" id="{$vo.id}" > 未通过审核</a>
                            </div>
                        </td>
                    <else />
                        <td style="position: relative;">
                            <span class="wcheck">待审核</span>
                            <div class="modal-wcheck" style="position: absolute; top: -41%; left: -20%; width: 268px;">
                                <a class="checkyes" id="{$vo.id}" > 审核通过</a>  
                                <a class="checkno" id="{$vo.id}" > 未通过审核</a>
                            </div>
                        </td>
                    </if>

                </tr>
            </volist>
        </table>
        <div class="index-paging">
            {$show_page}
        </div>
    </div>
</block>
<block name='script'>
    <script type="text/javascript">
        //审核模特
        $(function(){
            var hi = $(window).innerHeight();
            $(".zao").height(hi);
            $(".zao").click(function(){
                    $(".modal-wcheck").hide();        		
                    $(this).hide();        		
            });
            //单击审核查看审核信息
            $(".wcheck").live('click',function(){
                 $(this).parent('td').find(".modal-wcheck").show();
                 $(".zao").show();
            });
            $(".mobie-img").hover(function(){
            	$(this).next('.mobie-img2').show()
            	
            },function(){
            	
            	$(this).next('.mobie-img2').hide()
            	
            })
         
            
            //审核通过
            $('.checkyes').click(function(){
                var id = $(this).attr('id');
                var check = $(this).parents('td').find('.wcheck');
                $.post(
                    "{:U('Admin/Model/checkModelCard')}",
                    {uid:id, status:1},
                    function(data){
                        if(data.code == 1){                        
                            check.text('审核通过');
                            $(".modal-wcheck").hide();
                            $('.zao').hide();
                        }
                    }
                );
            });
            //审核未通过
            $('.checkno').click(function(){
                var id = $(this).attr('id');
                var check = $(this).parents('td').find('.wcheck');
                $.post(
                    "{:U('Admin/Model/checkModelCard')}",
                    {uid:id, status:2},
                    function(data){
                        if(data.code == 1){                        
                            check.text('审核未通过');
                            $(".modal-wcheck").hide();
                            $('.zao').hide();
                        }
                    }
                );
            });
        });
    </script>
</block>